package com.it.stringdemo;

public class StringDemo9 {
    public static void main(String[] args) {
        //1.获取到说的话
        String talk = "你玩的真好，以后不要玩了，TMD";

        //2.定义一个敏感词库
        String[] arr = {"TMD","CNM","SB","MLGB"};

        //3.循环得到数组中的每一个敏感词，替换
        //2.把里面的敏感词TMD替换为***
        for (int i = 0; i < arr.length; i++) {
            talk = talk.replace(arr[i],"***");
        }

        //打印结果
        System.out.println(talk);

    }
}
